home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / GNU_C++ / LIB / MTLB49CF.LZH / include / minimal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-29  |  1.1 KB  |  84 lines

  1. #ifndef _MINIMAL_H
  2. #define _MINIMAL_H
  3.  
  4. #ifndef _COMPILER_H
  5. #include <compiler.h>
  6. #endif
  7.  
  8. #ifndef _OSBIND_H
  9. #include <osbind.h>
  10. #endif
  11.  
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15.  
  16. int errno;
  17. #ifndef __MINT__
  18. int _console_dev = 2;
  19. #endif
  20.  
  21. #ifndef __MINT__
  22.  
  23. __EXTERN __EXITING __exit __PROTO((long)) __NORETURN; /* def in crt0.c */
  24. int       raise    __PROTO((int sig));
  25. void     _exit  __PROTO((int status));
  26.  
  27. void _exit(status)
  28.     int status;
  29. {
  30.     __exit((long)status);
  31. }
  32.  
  33. int
  34. raise(sig)
  35. int sig;
  36. {
  37.     return 0;
  38. }
  39.  
  40. #else
  41.  
  42. __EXTERN __EXITING _exit __PROTO((int)) __NORETURN;
  43. #define __exit _exit
  44.  
  45. #endif /* __MINT__ */
  46.  
  47. void     _init_signal __PROTO((void));
  48. void      exit  __PROTO((int status));
  49. void     _main  __PROTO((long argc, char **argv, char **environ));
  50. void __main __PROTO ((void));
  51.  
  52.  
  53. void
  54. _init_signal()
  55. {
  56. }
  57.  
  58. __EXITING
  59. exit(status)
  60.     int status;
  61. {
  62.     __exit(status);
  63. }
  64.  
  65. void __main ()
  66. {
  67. }
  68.  
  69. void _main(argc, argv, environ)
  70.     long argc;
  71.     char **argv;
  72.     char **environ;
  73. {
  74.     /* Avoid prototyping main, it will conflict with user's version */
  75.     __EXTERN int main ();
  76.     exit(main((int)argc, argv, environ));
  77. }
  78.  
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82.  
  83. #endif /* _MINIMAL_H */
  84.